package com.xtwy.admin.controller;

import com.xtwy.admin.model.User;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * 类的描述：
 *
 * @作者: 侯建军
 * @邮箱: 474177818@qq.com
 * @博客: https://blog.csdn.net/marquis888
 * @创建日期: 2018年11月17日  22:18
 * @版本: v1.0
 * @jdk版本使用: JDK1.8
 */
@RestController
@RequestMapping("/admin")
@Api(value = "用户controller", tags = {"用户操作接口"})
public class IndexController {
    @ApiOperation("查询测试")
    @GetMapping("/select")
    @ApiImplicitParams({
            @ApiImplicitParam(name="name",value="用户名",dataType="string", paramType = "query",example = "houjianjun"),
            @ApiImplicitParam(name="id",value="用户id",dataType="long", paramType = "query")})
    public void select(String name,Long id) {
    }

    @ApiOperation(value = "获取信息", notes = "获取信息1", httpMethod = "GET")
    @GetMapping("/get")
    @ResponseBody
    public Object get() {
        Map map = new HashMap();
        map.put("key1", "nihao");
        map.put("key2", "nishi");
        return map;
    }

    @ApiOperation(value = "获取用户信息", tags = {"获取用户信息copy"}, notes = "注意问题点")
    @GetMapping("/getUserInfo")
    public User getUserInfo(@ApiParam(name = "id", value = "用户id", required = true) Long id, @ApiParam(name = "username", value = "用户名") String username) {
        User user = new User();
        return user;
    }


}
